package demo;

import java.math.BigInteger;
import java.util.HashSet;
import java.util.Scanner;

/**
 * @Author liangzai
 * @Description:
 */
public class Training {
    public static void main1(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 39; i++) {
            sum += i;
        }
        System.out.println(sum+" "+(sum-19));
        System.out.println(761);
    }

    public static void main2(String[] args) {
        int INF = 0x3f3f3f3f;
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long sum = 0;
        int max = -INF;
        int min = INF;
        int val = 0;
        for (int i = 0; i < n; i++) {
            val = scanner.nextInt();
            sum += val;
            max = Math.max(max, val);
            min = Math.min(min, val);
        }
        System.out.println(max);
        System.out.println(min);
        System.out.printf("%.2f",(float)((float)sum/n));
    }

    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string = scanner.next();
        int[] arr = new int[26];
        int len = string.length();
        int max = -0x3f3f3f3f;
        int index = 0;
        for (int i = 0; i < len; i++) {
            char ch = string.charAt(i);
            arr[ch-'a']++;
            //max = Math.max(max,arr[ch-'a'] );
//			if(max<arr[ch-'a']) {
//				max = arr[ch-'a'];
//				index = ch-'a';
//			}
        }
        for (int i = 0; i < 26; i++) {
            //max = Math.max(max, arr[i]);
            if(max<arr[i]) {
                max = arr[i];
                index = i;
            }
        }
        System.out.println((char)(index+'a'));
        System.out.println(max);
    }

    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string = scanner.next();
        int len = string.length();
        int sum = 0;
        for (int i = 0; i < len; i++) {
            for (int j = i; j < len; j++) {
                sum += fun(string.substring(i,j+1));
            }
        }
        System.out.println(sum);
    }

    private static int fun(String str) {
        HashSet<Character> set = new HashSet<>();
        int len = str.length();
        for (int i = 0; i < len; i++) {
            char ch = str.charAt(i);
            set.add(ch);
        }
        return set.size();
    }

    public static void main(String[] args) {
        HashSet<Character> set = new HashSet<>();
        Scanner scanner = new Scanner(System.in);
        String string = scanner.next();
        int len = string.length();
        int[] dp = new int[len+1];

    }

    public static void main5(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        BigInteger ret = new BigInteger("1");
        for (int i = 2; i <= n; i++) {
            ret = ret.multiply(new BigInteger(String.valueOf(i)));
        }
        System.out.println(ret.toString());
    }
}
